<template>
<div>
    数字：{{num}}
</div>
<button @click="add">+1</button>
<button @click="dec">-1</button>
</template>
<script setup>
import { ref } from 'vue';

   let num =ref(1);
   const add=()=>{
     num.value++;  
    }
    function dec(){
        num.value--;
    }
   

</script>